<template>
  <div class="containter">
    <div class="header">--- 培训记录数据统计整理 ---</div>
    <el-collapse class="container" v-model="activeSelect" accordion>
      <el-collapse-item name="1" v-if="loginUser.roles == 'ROLE_ADMIN'">
        <template class="header" slot="title">
          <i v-if="activeSelect == 1" class="el-icon-caret-bottom"></i
          ><i v-else class="el-icon-caret-right"></i> 教师工作量统计
        </template>
        <Teacher-workload-card />
      </el-collapse-item>
      <el-collapse-item name="2">
        <template class="header" slot="title">
          <i v-if="activeSelect == 2" class="el-icon-caret-bottom"></i
          ><i v-else class="el-icon-caret-right"></i> 小组培训量统计
        </template>
        <Group-record-card />
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
import TeacherWorkloadCard from "./statisticsCards/teacherWorkload.vue";
import GroupRecordCard from "./statisticsCards/groupRecord.vue";
export default {
  components: {
    TeacherWorkloadCard,
    GroupRecordCard,
  },
  data() {
    return {
      activeSelect: "0",
      loginUser: {
        roles: "ROLE_GUEST",
        realName: "",
        studentId: "",
      },
    };
  },

  created() {
    if (window.sessionStorage.getItem("user") != null) {
      this.loginUser = JSON.parse(window.sessionStorage.getItem("user"));
    }
  },

  mounted() {},

  methods: {},
};
</script>

<style lang="less" scoped>
.containter {
  width: 75%;
  min-width: 1000px;
  margin: auto;

  .header {
    color: white;
    font-size: 28px;
    font-weight: bold;
    width: 100%;
    text-align: center;
    height: 50px;
  }
  .el-collapse {
    // border: 2px black solid;
    border-radius: 5px;
    padding-left: 10px;
    padding-right: 10px;
    background-color: rgb(255, 255, 255) !important;
    width: 95%;
    margin: auto;

    /deep/ .el-collapse-item__header {
      background-color: rgba(255, 255, 255, 0.486) !important;
      padding-left: 10px;
      font-size: 100%;
      transition: 0.2s ease all;
      letter-spacing: 1px;

      display: flex;
      white-space: pre;
    }
  }
}
</style>